<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=3,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>GO机网</title>
    <link href="../css/reset-html5.css" rel="stylesheet">
    <link href="../css/mui.min.css" rel="stylesheet">
    <link href="../css/mui.picker.min.css" rel="stylesheet">
    <link href="../css/wx-main.css?20161028_1" rel="stylesheet">
    <script src="../js/jquery-2.2.1.min.js"></script>
    <script src="../plugins/vue/vue.min.js"></script>
    <style>
        body{
            font-size: 14px;
        }
    </style>
</head>
<body id="main">
<header class="text-color1">
        <span class="left-btn text-color2" onclick="location.href='index.html'">
            首页
        </span>
    我的机友
        <span class="right-btn text-color2" onclick="location.href='bind_on_account_for_jiyou.html'">
            账号
        </span>
</header>

<div>
    <div class="mui-card" v-show="order_list.one.length==0">
        <div class="mui-card-content">
            <div class="mui-card-content-inner">
                暂无机友数据
            </div>
        </div>
    </div>




</div>
</body>
<script src="../js/phone.js"></script>
<script>

    Date.prototype.Format = function(format) {
        var date = {
            "M+": this.getMonth() + 1,
            "d+": this.getDate(),
            "h+": this.getHours(),
            "m+": this.getMinutes(),
            "s+": this.getSeconds(),
            "q+": Math.floor((this.getMonth() + 3) / 3),
            "S+": this.getMilliseconds()
        };
        if (/(y+)/i.test(format)) {
            format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
        }
        for (var k in date) {
            if (new RegExp("(" + k + ")").test(format)) {
                format = format.replace(RegExp.$1, RegExp.$1.length == 1
                        ? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
            }
        }
        return format;
    }

    //将UTC格式转为正常的日期格式输出
    function getUTCTime(second) {
        var d = new Date();

        //转换毫秒
        d.setTime(second * 1000);

        /*
         var year=d.getFullYear();
         var month=d.getMonth()+1;
         var datenum=d.getDate();
         var hour = d.getHours();
         var minute = d.getMinutes();
         var second = d.getSeconds();
         return year+"-"+month+"-"+datenum + " " + hour+":"+minute+":"+second;
         */

        return d.Format("yyyy-MM-dd hh:mm");
    }


    Vue.filter('getLocalTime', function (value) {
        return getUTCTime(value)
    });


    var vue = new Vue({
        el:"#main",
        data:{
            order_list:''
        },
        methods:{
            'get_order_list':function(){
                var that = this;
                $.post('../index/index.php?m=Home&c=Index&a=getTicketList',{},function(res){
                    if(res.code==200){
//                        alert(res.message);
                        that.order_list = res.data
                    }else if(res.code==0){
                        login();
                    }
                },'json');
            },
            'go_order_info':function(id){
                location.href = "order_info.html?order_id="+id;
            }
        },
        ready:function(){
            this.get_order_list();
        }
    });

    Vue.filter('getStatus', function (value) {
        return getStatus(value)
    });

    function getStatus(value){
        var status = '';
        switch(parseInt(value))
        {
            case 1:
                status = '已下单';
                break;
            case 2:
                status = '已下单';
                break;
            case 3:
                status = '待维修';
                break;
            case 4:
                status = '待付款';
                break;
            case 5:
                status = '待评价';
                break;
            case 6:
                status = '已完成';
                break;
        }
        return status;
    }

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return '';
    }
</script>
</html>